/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package simulation;

import jade.core.AID;
import jade.core.behaviours.OneShotBehaviour;
import jade.lang.acl.ACLMessage;

/**
 *
 * @author Danielondon
 */
public class SendMessage extends OneShotBehaviour {
    private AID receiverId;
    private String content;
    int performative;
    
    public SendMessage(String content, AID receiver, int performative) {
        this.content = content;
        this.receiverId = receiver;
        this.performative = performative;
    }

    @Override
    public void action() {
        //System.out.println("Sending Message to " + receiverId);
        ACLMessage message = new ACLMessage(performative);
        message.addReceiver(receiverId);
        message.setContent(content);
        message.setConversationId("simulation");
        message.setReplyWith("msg "+System.currentTimeMillis());
        this.myAgent.send(message);
    }
    
    
    
}
